Battles Plan Possible Ideas :: Instead of adding to stats have a percent increase 6:01:50 PM oh, i notice in this version, when you switch to another pkmn to Ko the opponenet pkmn, the switched in pkmn onnly get exp, the switched out pkmn dont Implemented Updates :: Move Priority Battle Status is saved upon refreshing Notification upon Trainer Level Up Flinching Pay Day is affected by Amulet Coin (as it is in games) Added Stat Modifier Fairy Type added 1/250 for *10 money Fainted pokemon can't recieve exp from exp share New Captcha Bonus & new captcha File Organization :: /battle_create.php?Battle=[Trainer,Gym,ect]&Trainer=[ID] Upon load this file will create the battle and instantly redirect /battle.php Errors should be stored as $_SESSION['error'] and displayed on redirect The goal of this is to allow /battle.php to not recreate the battle when refreshing /battle.php Will precontain the html layout and instantly load a json file to upadate the battle All battle actions will be here /battles/battle.handler.php POST { battleID:[Unique identifier for all battles] move:[Unique move string (must be different for all moves); if using a move] continue:[Unique continue string] dummy:[true if there is no action ie Opening page or exiting bag] x:[e.pageX] y:[e.pageY] if button logs have been toggled for this user button_width:$(this).attr('width') [This is to check for stylish] button_height:$(this).attr('height') [Edited css files would change height/width] } This file accepts inputs, calls functions, and generates a json output (noted below) /battles/battle.class.php Contains the Battle class. This will be the largest file by far /battles/battle.bag.php Contains extra resources for using the bag /battles/battle.options.php Contains extra resources for battle options ** Below are possibilities ** /battles/battle.abilities.php Would contain a -large- class with all abilities as "functions" you would be able to call on the methods of the abilities functions regularly inside the real battle class. (Basically a simliar implimentation to showdown) The reasoning behind this is there would be no reason to have 180 if statements inside the battle class for each of the abilities /battles/battle.moves.php Depending on how many special moves I want to impliment, I can also do a similar thing as abilities /battles/battle.items.php Exact same situation as moves Status Conditions :: Non-volatile :: Only one of these can be present at a time on a Pokemon Burn :: Fire Types cannot be burned ability Water Veil cannot be burned Halves damage dealt by phyiscal moves E>if ability==Guts: +50% attack -1/8 max hitpoints on turn end E>if ability==Heatproof: -1/16 hitpoints Freeze :: When frozen you cannot move Fire type moves used on a frozen pokemon results in unfreeze 20% chance to be cured of frozen per turn Cannot be frozen in sunny weather Ice types cannot be frozen Frozen pokemon can use Fusion Flare, Flame Wheel, Sacred Fire, Flare Blitz and Scald while frozen; these moves will thaw the user, thaw the opponent if possible, and deal damage to the opponent. Paralysis :: 1/4 chance to not hit Speed -25% E>if ability == Quick Feet: Speed +25% Ground-type Pokémon can be paralyzed, but not by Electric-type moves Electric pokemon cannot be paralyzed Poison :: -1/8 max hp per turn E>if ability == Poison Heal +1/8 max hp per turn Steel Poison and ability Immunity cannot be poisoned Badly Poisoned :: -(1/16 * length) max hp per turn same as poison Sleep :: Asleep pokemon can only use Snore and Sleep Talk Sleep lasts 1-3 turns Volatile :: Confusion :: 1/2 chance to hurt in confusion meaning 40-power typeless physical attack Confuse lasts 1-4 turns if ability==Own Tempo: no confuse Curse :: -1/4 max hp every turn defeating the opponent removes curse Embargo :: tempoarly removes held item for 5 turns Encore :: Force repeat last attack for 2-5 turns Flinch :: prevents pokemon from attacking have as volatile??? Heal Block :: not necesarry to impliment Prevented from healing for 5 turns No absorb moves No leftovers No volt absorb or water absorb Identification :: ??? Infatuation :: cannot attack 50% of the time ability Oblivious cannot be infauated removed upon either pokemon switched out Nightmare :: sleeping pokemon lose 1/4 hp every turn Partially Trapped :: lasts 2-5 turns -1/8 max hp per turn E>Item = binding band -1/6 map hp per turn E>type = ghost: no hp loss Magma Storm, Sand Tomb, Whirlpool, Wrap, Bind, Clamp, Infestation, or Fire Spin Multiple trappings can go on at once > Can be a valid strat for WTC killing Perish Song :: after 3 turns everyone dies E>ability soundproof removed on switching output Seeding :: caused by leechseed -1/8 max hp from seeded +same amount to seeder Taunt :: Cannot use non-damaging moves for 3 turns >ability Armoa Viel Telekinetic Levitation :: levitated by telekinesis immune to ground types not sure if I shoudl bother Torment :: You can't use the same move twicein a row Trapped :: Cannot switch until the pokemon is defeated or you die E>Ghost Types E>Item shedshell E>U-turn, Volt switch baton pass E>hit with whirlwind roar dragon tail circle throws Accuraccy :: acc = base_acc if ability = Wonder Skin && move['power'] == 0: acc = 50 acc_mod = D[StatMod][Eva] - A[StatMod][Acc] acc = applyModifier(acc, acc_mod) ADD >> if (acc_mod > 6) acc_mod = 6 if (acc_mod < -6) acc_mod = -6 if D[item] == Brightpowder or Lax Incense: acc *= 0.9 if A[item] == Wide Lens: acc *= 1.1 if A[item] == Zoom Lens && isSecondMove(): acc *= 1.2 if A[ability] == Compoundeyes: acc *= 1.3 if A[ability] == Victory Star: acc *= 1.1 if A[ability] == Hustle && move[catergory] == physical: acc *= 0.8 if D[ability] == Sand Veil && weather() == Sandstorm: acc *= 0.8 if D[ability] == Snow Cloak && weather() == Hail: acc *= 0.8 if D[ability] == Tangled Feet && D[Status] == confused: acc /= 2 if weather() == foggy: acc *= 0.6 if battle[Gravity]: acc *= 10/6 if acc > 100: acc = 100 if mt_rand(0, 99) < acc: HIT else: MISS Money Formula :: =(total_level * 2) +((pokemon_level * pay_day_used[max=4])/2) +25% if Amulet Coin or Luck Incense (not ig atm) +100% if Amulet Coin+ +clan_money_boost% if in clan *10 if random(1, 250) = 100 Captcha :: =Random(30000 * TrainerLevel , 100000 * TrainerLevel) +clan_money_boost if in clan >No Amulet Coin Boost Captchas have a 1/200 chance to appear after pressing the continue button. They no longer are based off the number of moves, but Pokemon defeated. Technically fighting 1 pokemon parties will result in no Captchas ever showing up, but that isn't allowed anyway. Weather :: Sunlight :: Advantages Increases the power of Fire-type moves by 50%. Allows Solar Beam to be used instantly. In Generation V and on, causes Growth to raise Attack and Special Attack two stages each. * Guarantees Harvest will restore a held Berry. Changes Weather Ball to a Fire-type move and doubles its power. * Changes Castform to its Sunny Form and Cherrim to its Sunshine Form. Prevents Pokémon from becoming frozen. Causes Moonlight, Synthesis, and Morning Sun to recover ⅔ of max HP (twice the normal amount in Generation II). Disadvantages Decreases the power of Water-type moves by 50%. Lowers accuracy of Thunder and Hurricane to 50%. Rain :: Advantages Increases the power of Water-type moves by 50%. Allows Thunder and Hurricane to bypass accuracy check. Changes Weather Ball to a Water-type move and doubles its power Changes Castform to its Rainy form. Disadvantages Decreases the power of Solar Beam and all Fire-type moves by 50%. Causes Moonlight, Synthesis, and Morning Sun to recover ¼ of max HP since Generation III, or half the normal amount in Generation II. Sandstorm :: Advantages Raises the Special Defense of all Rock-type Pokémon by 50% (Generation IV onwards). Changes Weather Ball to a Rock-type move and doubles its power. Disadvantages Damages all Pokémon not part Rock-, Steel-, or Ground-type or those who don't have Sand Force, Sand Rush, Sand Veil, Magic Guard or Overcoat as their Ability or Pokémon holding the Safety Goggles for 1/16 (⅛ in Generation II) of their maximum HP. Causes Solar Beam to only deal half of its normal damage. Causes Moonlight, Synthesis, and Morning Sun to recover ¼ of max HP (half the normal amount in Generation II). Hail :: Advantages Changes Weather Ball to a Ice-type move and doubles its power. * Changes Castform to its Hail Form. Allows Blizzard to bypass accuracy check (Generation V onward), or makes its accuracy 100% (in Generation IV). Disadvantages Damages all Pokémon that do not have the Ice-type or the Abilities Ice Body, Snow Cloak, Magic Guard, or Overcoat. Causes Solar Beam to deal only half its damage. Causes Moonlight, Synthesis, and Morning Sun to recover ¼ of max HP. Random :: Upon trainer level up SUPER CELEBRTATION (Like even more so on 12 and THIRTEEN) Battle Factory atm you can have traded a pokemon and if you were still in a battle it can gain exp or ect. Have WHERE clauses for ownership inside querys Handle clan level ups INSIDE mines / battles & Display "Elite has leveled up to level 580!" Clan Credits given upon level up Battle Session :: $_SESSION['battle'] = Array( 'id' => Unique battle identifier, 'Type' => [Trainer,BattleTower,ect] 'Captcha' => true, // This needs to be extrapolated into the database somehow or logged if log in/out 'TimeStarted' => time(), 'moves' => Array( 'afelfsbfieub', 'owuienfpubrq', 'fjbdkjslaewp', 'woeuifwpuewe' ), 'logs' => Array( Array( 'x' 'y' 'Type' [C,1,2,3,4,Switch,Item?] ) repeat for all moves ), 'Clan' => Array( 'id'=> [NULL, id] 'exp_boost' => [1, precalculated boost] 'money_boost' => [1, precalculated boost] ), 'MoneyMultipler' [Set to 1.25 if Amulet Coin or Luck Incense is equipped] 'PayDayMoney' [Set only if pay day is there 'PayDayNum' [Cannot exceed 4] ); $_SESSION['A'] = Array( 'UserID' 'Username' 'Sel' => 1, 'TotalPokemon' => Number of Pokemon in party, 1 => Array( 'CurrentHP' => $PokeInfo['Stats'][0], 'MaxHP' => $PokeInfo['Stats'][0], 'StatMod' => Array( //these values go from -6 to 6 0,0,0,0,0, //6 normal stats 0, //Accuracy 0 //Evasion ), 'Status' => 'Normal', //paralyzed ect 'ID' => $PokeInfo['id'], 'PokeID' => $PokeInfo['poke_id'], 'AltID' => $PokeInfo['alt_id'], 'Fullname' => $PokeInfo['Fullname'], 'Nickname' => $PokeInfo['Nickname'], 'Level' => $PokeInfo['Level'], 'CurrentExp' => $PokeInfo['CurrentExp'], 'ExpNextLevel' => $PokeInfo['ExpNextLevel'], 'BaseStats => $PokeInfo['Base'], 'Stats' => $PokeInfo['Stats'], 'Ability' => $PokeInfo['Ability'], 'Nature' => $PokeInfo['Nature'], 'Type1' => $PokeInfo['Type1'], 'Type2' => $PokeInfo['Type2'], 'Item' => $PokeInfo['RealItemID'], 'ItemName' => $PokeInfo['Item'], 'Gender' => $PokeInfo['GenderSmall'], 'Sprite' => $PokeInfo['Sprite'], 'Icon' => $PokeInfo['Icon'], 'Moves' => Array( Array( 'Name' 'Type' 'Catergory' [Special, Physical] 'Power' 'Color' 'Accuracy' 'Crit' 'Recoil' //Given as percent of damage dealt when used ) repeat for 4 moves ) ) repeat for 6 pokemon $_SESSION['D'] exact same as Attacker except 'isNPC' => [true,false] json_output :: { Battle:{ Text:{ 0:x used x and dealt x damage 1:its super effective 2:ect } }, A:{ Active:{ Slot: 1, Fullname: , Sprite: Level: EXP: { Current: Max: }, HP: { Current: Max: }, Item:{ Exists:true, Icon: Name: }, Status:{ Name: Color: }, Moves:{ m1:{ Name: Color: //determine color with php }, repeat with all 4 moves } }, 1:{ Name: Icon: Status: //ENUM(Active, Party, Fainted) EXP: { Current: Max: }, HP: { Current: Max: } } repeat for all 6 pokes }, D:{ exact same as Attacker } }